import request from '@/utils/request'

//初始化候选人框
export function initCandidate(choiceType, dataInfo) {
  switch (choiceType) {
    case "null":
      //默认
      return request({
        url: '/oa/orgUserTree/AllCorp/null',
        method: 'get',
      });

    case "appointUser":
      //指定人员

      return "";

    case "appointCompany":
      //指定公司
      return request({
        url: '/oa/orgUserTree/AllCorp/' + dataInfo.appointCompany,
        method: 'get',
      });

    case "appointDept":
      //指定部门
      return request({
        url: '/oa/orgUserTree/AllCorp/' + dataInfo.appointDept,
        method: 'get',
      });
    case "appointTeam":
      //指定科室
      return request({
        url: '/oa/orgUserTree/AllCorp/' + dataInfo.appointTeam,
        method: 'get',
      });

    case "appointOrg":
      //指定组织字段
      return request({
        url: '/oa/orgUserTree/appointOrgField/' + dataInfo.orgField,
        method: 'get',
      });
    case "crruentOrg_team":
      //当前科室
      return request({
        url: '/oa/orgUserTree/currentOrgForTeam',
        method: 'get',
      });
    case "crruentOrg_dept":
      //当前部门
      return request({
        url: '/oa/orgUserTree/currentOrgForDept',
        method: 'get',
      });

    case "crruentOrg_team_manager":
      //当前室经理
      return request({
        url: '/oa/orgUserTree/currentOrgTeamManager',
        method: 'get',
      });
    case "crruentOrg_dept_manager":
      //当前部门经理
      return request({
        url: '/oa/orgUserTree/currentOrgDeptManager',
        method: 'get',
      });
    case "role":
      //计算按角色
      return request({
        url: '/oa/orgUserTree/role/' + dataInfo.role,
        method: 'get',
      });
    case "roleAndDept":
      //计算角色和部门
      return request({
        url: '/oa/orgUserTree/roleAndDept',
        params: {
          appointDept: dataInfo.appointDept,
          role: dataInfo.role
        },
        method: 'get',
      });
    case "roleAndCrruentDept":
      //计算角色和部门
      return request({
        url: '/oa/orgUserTree/roleAndCurrentDept',
        method: 'get',
      });
  }

}

//初始化流程提交框(从流程引擎获取)
export function initProcessFormData(processId, taskId) {
  return request({
    url: '/process/preSubmitForRouter/' + processId + '/' + taskId,
    method: 'get',
  })
}
